import {RouteRecordRaw} from "vue-router";
import {portalRoutes} from "/@/router/portal";
export const Layout = () => import("/@/layouts/portal/index.vue")
export const ROOT = {
    path: '/',
    name: 'Root',
    redirect: '/home/index',
    meta: {
        title: 'Root',
    },
}


// 404 on a page
export const PAGE_NOT_FOUND_ROUTE: RouteRecordRaw = {
    path: '/:path(.*)*',
    name: 'ErrorPage',
    meta: {
        title: 'ErrorPage',
        hideBreadcrumb: true,
        hideMenu: true,
    },
    component: import('/@/views/exception/Exception.vue')
};


export const LoginRoute: RouteRecordRaw = {
    path: '/login',
    name: 'Login',
    component: () => import('/@/views/login/index.vue'),
    meta: {
        title: '登录',
    },
};

export const RegisterRoute: RouteRecordRaw = {
    path: '/register',
    name: 'Register',
    component: () => import('/@/views/register/index.vue'),
    meta: {
        title: '注册',
        ignoreAuth: true
    },
};


export const BasicsRoutes: Array<RouteRecordRaw> = [
    ROOT,
    LoginRoute,
    RegisterRoute,
    {
        path: '/search',
        component: Layout,
        meta: {
            title: '全站搜索',
        },
        children: [{
            path: 'index',
            name: 'Search',
            component: () => import("/@/views/portal/search/index.vue"),
            meta: {
                title: '全站搜索',
                ignoreAuth: true
            },
        }]
    },
];
